home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / textfile / faqs / ps_faq / part7_10 < prev   
Encoding:
Internet Message Format  |  1992-12-26  |  30.5 KB

  1. Xref: bloom-picayune.mit.edu comp.lang.postscript:16096 news.answers:4301
  2. Newsgroups: comp.lang.postscript,news.answers
  3. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!tamsun.tamu.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!wupost!uunet!brunix!brunix!jgm
  4. From: jgm@cs.brown.edu (Jonathan Monsarrat)
  5. Subject: PostScript monthly FAQ v2.01 11-30-92 [07-10 of 12]
  6. Supercedes: <1992Oct29.210214.25837@cs.brown.edu>
  7. Message-ID: <1992Dec1.054343.15293@cs.brown.edu>
  8. Followup-To: poster
  9. Summary: Useful facts about the PostScript graphics programming language
  10. Sender: news@cs.brown.edu
  11. Reply-To: jgm@cs.brown.edu (PostScript FAQ comments address)
  12. Organization: Brown University Department of Computer Science
  13. Date: Tue, 1 Dec 1992 05:43:43 GMT
  14. Approved: news-answers-request@MIT.Edu
  15. Expires: Thu, 31 Dec 1992 00:00:00 GMT
  16. Lines: 828
  17.  
  18. Archive-name: postscript-faq/part7-10
  19. Last-modified: 1992/11/30
  20. Version: 2.01
  21.  
  22.                               -- PostScript -- 
  23.  
  24.                             Answers to Questions 
  25.  
  26.                    (the comp.lang.postscript FAQ v2.01) 
  27.  
  28.                                Jon Monsarrat 
  29.  
  30.                               jgm@cs.brown.edu 
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                      This FAQ is formatted as a digest. 
  38.  
  39.                 Most news readers can skip from one question 
  40.  
  41.                      to the next by pressing control-G. 
  42.  
  43.  
  44.     Changes since the last version are marked with a '|' in the table 
  45.     of contents and in the sections in the text-only format of the FAQ. 
  46.  
  47.     Please help fix the FAQ! All comments should be mailed to 
  48.     jgm@cs.brown.edu. My favorite way to receive a change suggestion is 
  49.     when it is accompanied by a section of the FAQ that is edited and 
  50.     mailed to me verbatim as an example. If you would like to 
  51.     contribute, please read the section ``about the FAQ'' first. Thank 
  52.     you! 
  53.  
  54.     Books and programs are referred to by name only. See the 
  55.     appropriate sections for full information. 
  56.  
  57.  
  58. Subject: 7 Programming in PostScript 
  59.  
  60.  
  61. Subject: 7.1 What is PostScript level 2? 
  62.  
  63.     PostScript Level Two is a major upgrade to PostScript Level One. 
  64.  
  65.     Starting from PostScript Level One as a basis, PostScript Level Two 
  66.     represents the confluence of many features: 
  67.  
  68.  
  69.  
  70.     * Composite fonts -- fonts with the capability of supporting 
  71.       character sets with more than 256 characters. Such fonts are 
  72.       needed in the Asian marketplace, for example. 
  73.  
  74.  
  75.     * Patterns -- provide a device-independent way to describe patterns 
  76.       which tile an area. A pattern can be thought of as another kind 
  77.       of ``color'' in PostScript Level Two. 
  78.  
  79.  
  80.     * Forms -- to meet the demands of the forms market, forms describe 
  81.       static information which can be repeated many times on one page 
  82.       or printed on many separate pages, or both. 
  83.  
  84.  
  85.     * Color -- the previous ill-defined color models are now enhanced 
  86.       with the addition of CMYK color, support for color images, CIE 
  87.       device-independent color (if anybody can understand the damned 
  88.       thing). 
  89.  
  90.  
  91.     * Halftones -- new highly accurate halftone screening methods to 
  92.       meet the needs of high end typesetting equipment. 
  93.  
  94.  
  95.     * Display PostScript -- many enhancements and efficiency 
  96.       improvements to support the needs of screen rendering. 
  97.       Enhancements include: 
  98.  
  99.  
  100.  
  101.        * efficient rectangle operators, 
  102.  
  103.  
  104.        * efficient font and text operators, 
  105.  
  106.  
  107.        * multiple contexts 
  108.  
  109.  
  110.        * shared memory models 
  111.  
  112.  
  113.        * hit detection 
  114.  
  115.     A detailed description of PostScript 2 is available in the section 
  116.     on PostScript 2. 
  117.  
  118.  
  119. Subject: 7.2 Should I learn level 2 PostScript? 
  120.  
  121.     Yes, because Level Two will soon become the standard. Application 
  122.     developers using PostScript need to become aware of the new 
  123.     capabilities and how to take advantage of them. 
  124.  
  125.     There are many good books on PostScript 2. (See Section 5, 
  126.     ``Books''.) 
  127.  
  128.  
  129. Subject: 7.3 Where can I find examples of PostScript code? 
  130.  
  131.     Many other books on PostScript make example PostScript code 
  132.     available. ``Thinking in PostScript'', by Glenn Reid, is the only 
  133.     book I know of that allows its examples to be freely distributed. 
  134.     (See Section 5, ``Books''.) 
  135.  
  136.     All the examples in ``the blue book'' are available from the Adobe 
  137.     file server (See Section 5, ``Books''.) 
  138.  
  139.     See the question ``How can I browse through PostScript programs?'' 
  140.     in the section on utilities. 
  141.  
  142.  
  143. Subject: 7.4 How do I get the physical size of a page? 
  144.  
  145.     The initial clipping path gives you the size of the imagable area. 
  146.     Use ``clippath pathbbox'' to get these coordinates. If you must 
  147.     know the size of the device's imageable area, use the sequence 
  148.     ``gsave initclip clippath pathbbox grestore'', but this will 
  149.     prevent an enclosing application from using the clippath to achieve 
  150.     some special effects (such as multiple pages per page). 
  151.  
  152.  
  153. Subject: 7.5 Why can't I do a pathforall after a charpath ? 
  154.  
  155.     (See Section 4, ``Fonts'', question ``Why are Adobe fonts 
  156.     hidden?''.) 
  157.  
  158.  
  159. Subject: 7.6 How do I center a string of text around a point? 
  160.  
  161.     Level 1 PostScript has two operators that can extract information 
  162.     about the metrics of characters: ``stringwidth'' and ``charpath''. 
  163.  
  164.     The ``stringwidth'' operator returns the advance width of its 
  165.     string operand. This is the distance the current point would be 
  166.     moved by a ``show'' operation on the same string. ``stringwidth'' 
  167.     returns two numbers on the stack, representing the x and y 
  168.     components of the advance width. Usually the y component is zero 
  169.     because most fonts are displayed along a horizontal line, moving 
  170.     the current point only in the x direction. 
  171.  
  172.     Also note that the ``stringwidth'' operator includes any side 
  173.     bearings in its result. It usually does not give an exact measure 
  174.     of the area of the page that will be touched by its operand. 
  175.  
  176.     If all that an application requires is horizontal centering of a 
  177.     long string of text, the result returned by ``stringwidth'' is 
  178.     sufficient. A common technique is 
  179.  
  180.   
  181.           x y moveto
  182.           (string) dup stringwidth pop 2 div neg 0 rmoveto show
  183.   
  184.     (This code makes the assumption that the y component of advance 
  185.     width is irrelevant.) 
  186.  
  187.     The ``charpath'' operator extracts the graphic shapes of its string 
  188.     operand and appends them to the current path in the graphic state. 
  189.     These shapes can then be processed by other PostScript operators. 
  190.     To get the actual size of the area touched by a character a simple 
  191.     approach is 
  192.  
  193.   
  194.           gsave
  195.           newpath
  196.           0 0 moveto
  197.           (X) true charpath flattenpath pathbbox
  198.           grestore
  199.   
  200.     This code places four numbers on the stack, representing the 
  201.     coordinates of the lower left and upper right corners of the 
  202.     bounding box enclosing the character ``X'' rendered with the 
  203.     current point at (0,0). 
  204.  
  205.     There are two things to be careful about when using the code shown 
  206.     above: 
  207.  
  208.  
  209.  
  210.    1. There are severe limits on the size of the string operand, 
  211.       related to the limit on the number of elements in a graphic path. 
  212.       The PostScript Language Reference Manual recommends taking 
  213.       ``charpath''s one character at a time. 
  214.  
  215.  
  216.    2. If user space is rotated or skewed with respect to device space, 
  217.       the result from ``pathbbox'' may be larger than expected; 
  218.       ``pathbbox'' returns a rectangle oriented along the user space 
  219.       coordinate axes, which fully encloses a (possibly smaller) 
  220.       rectangle oriented along the coordinate axes of device space. If 
  221.       user space is rotated at an integer multiple of 90 degrees these 
  222.       two rectangles will be the same, otherwise the rectangle in user 
  223.       space will be larger. 
  224.  
  225.     So, to center text vertically one must get the bounding boxes of 
  226.     all the characters in the string to be displayed, find the minimum 
  227.     and maximum y coordinate values, and use half the distance between 
  228.     them to displace the text vertically. 
  229.  
  230.     If an application does this repeatedly, it would be wise to store 
  231.     the bounding boxes in an array indexed by character code, since 
  232.     ``charpath'' is a slow operation. 
  233.  
  234.     Font metric information is available outside of a PostScript 
  235.     printer in font metrics files, available from Adobe. A program 
  236.     generating PostScript output can obtain metrics from these files 
  237.     rather than extracting the metrics in the printer. 
  238.  
  239.  
  240. Subject: 7.7 How can I concatenate two strings together? 
  241.  
  242.   
  243.   %% string1 string2 append string
  244.   % Function: Concatenates two strings together.
  245.   /append {
  246.            2 copy length exch length add  % find the length of the new.
  247.            string dup     % string1 string2 string string
  248.            4 2 roll       % string string string1 string2
  249.            2 index 0 3 index
  250.            % string string string1 string2 string 0 string1
  251.            putinterval    % stuff the first string in.
  252.            % string string string1 string2
  253.            exch length exch putinterval
  254.   } bind def
  255.   
  256.  
  257. Subject: 7.8 What do I do when I get stack overflow/underflow? 
  258. |
  259. |   These errors are among the most common in PostScript. 
  260. |
  261. |   When I get a stack overflow, that is usually a sign that a routine 
  262. |   is leaving an object on the stack. If this routine gets called 2000 
  263. |   times, it leaves 2000 objects on the stack, which is too many. 
  264. |
  265. |   When I get a stack underflow, that is a sign that either: (A) one 
  266. |   of the routines in the program doesn't work, and never has or (B) 
  267. |   one of the routines in the program works, but expects to be called 
  268. |   with some arguments left on the stack. 
  269. |
  270. |   There is no such thing as a PostScript debugger right now. For now, 
  271. |   the best that you can do to debug your program is to put in lots of 
  272. |   print statements. Learn to use the PostScript pstack command, and 
  273. |   use an online interpreter so you don't have to run to the printer 
  274. |   for each debugging cycle. 
  275. |
  276. |   Use an error handler to learn more about what exactly is happening 
  277. |   when your program crashes. (see Section 12, ``PostScript 
  278. |   Interpreters and Utilities'') 
  279. |
  280. |   If your code has never worked yet (i.e. you are still writing it) 
  281. |   then I find that it helps to put little comments in the margin 
  282. |   about the state of the stack. Like this: 
  283. |
  284. |  
  285. |         Heart pathbbox             % lowerx lowery upperx uppery
  286. |         exch 4 -1 roll             % lowery uppery upperx lowerx
  287. |  
  288. |  
  289. |   I generally put these comments in originally, and then take them 
  290. |   out when the program works. Maybe this is a bad practice, in case I 
  291. |   ever want to go back and look at the code to modify it!! 
  292.  
  293.  
  294. Subject: 7.9 The Obfuscated PostScript Contest 
  295.  
  296.     Alena Lacova and Jonathan Monsarrat are running an Obfuscated 
  297.     PostScript Contest that will end on January 10th. 
  298.  
  299.     For information about the contest, write jgm@cs.brown.edu or ftp 
  300.     the rules from wilma.cs.brown.edu:pub/postscript/rules.ps or 
  301.     rules.txt. 
  302.  
  303. Subject: 8 Computer-specific PostScript 
  304.  
  305.     This section describes PostScript information specific to a 
  306.     particular type of computer or operating system. 
  307.  
  308.  
  309. Subject: 8.1 Sun Workstations 
  310.  
  311.     What is NeWS? 
  312.  
  313.     NeWS is Sun Microsystems PostScript-based window system for the Sun 
  314.     Workstation. NeWS was a project within Sun (started around 1985) to 
  315.     create a window system to supplant SunView (a very successful 
  316.     kernel-based window system). NeWS is a client-server model window 
  317.     system (like X) but among many of NeWS novel features was the use 
  318.     of PostScript as the language to describe the appearance of objects 
  319.     on the screen. Because there are few ways to design a knee joint, 
  320.     NeWS has many features in common with Display PostScript, but NeWS 
  321.     predates Adobe Display PostScript and was neither connected with 
  322.     Adobe Display PostScript nor endorsed by Adobe. NeWS is not an 
  323.     Adobe product, nor is it a Sun/Adobe joint venture. 
  324.  
  325.     NeWS had the potential to become a world-class window system had 
  326.     not a coalition of computer vendors ganged together to endorse the 
  327.     X window system from MIT, sending Sun into a frenzy to support both 
  328.     X and NeWS in the same window server. 
  329.  
  330.     One respected engineer from DEC remarked they all feared Sun would 
  331.     ignore the industry X coalition and go on to make NeWS a standard. 
  332.     They were overjoyed when Sun reacted by taking on X and merging it 
  333.     with NeWS, causing additional work which made it harder for Sun to 
  334.     make progress with NeWS. oAlso it made X the de facto standard; 
  335.     whether or not this is a good thing depends on who you talk to. 
  336.  
  337.     As of October 1992, Sun management signed a deal with Adobe to 
  338.     adopt Display PostScript for the Sun. The future of NeWS is still 
  339.     undecided (but it looks bad). 
  340.  
  341.     And how does PostScript run on them? 
  342.  
  343.     PostScript runs on NeWS. Due to lack of support from Sun 
  344.     management, NeWS never made it as a fully-compliant PostScript 
  345.     interpreter. There were incompatibilities between the NeWS 
  346.     PostScript interpreter and ``official'' PostScript interpreters as 
  347.     defined by Adobe and the Apple LaserWriter family of printers, such 
  348.     that many PostScript files which would print fine on a LaserWriter 
  349.     would not render under NeWS. The most critical incompatibility was 
  350.     the lack of support for Adobe Type 1 fonts, Sun having gone with 
  351.     their own font format known as F3. Given the NeWS PostScript 
  352.     interpreter was not even PostScript Level One compliant, the 
  353.     chances of bringing NeWS to Level Two compliance was remote, 
  354.     lending further to NeWS decline. 
  355.  
  356.  
  357. Subject: 8.2 IBM PC 
  358.  
  359.     You can find nenscript for OS/2 1.x--2.0 and MSDOS on 
  360.     ftp-os2.nmsu.edu in pub/uploads/nensc113.zip. 
  361.  
  362. |    There are rumors that Word Perfect and Microsoft Word don't produce 
  363. |    ``clean'' PostScript that follows the DSC conventions (See Section 
  364. |    9, ``Encapsulated PostScript''). This means that a lot of 
  365. |    PostScript utilities like Ghostview and psnup, etc., that require 
  366. |    the DSC conventions, will not work on them. 
  367. |
  368. |    Creating a PostScript file from MS Word 
  369. |
  370. |    Install the LaserWriter driver that comes with Windows.In the 
  371. |    printer setup, select a PostScript printer. Then click on the setup 
  372. |    button to get that pop-up. Then clik the Options button. Then 
  373. |    select the print to Encapsulated PostScript File. If you don't 
  374. |    specify a file name, Word will prompt you for one when you tell it 
  375. |    to print. 
  376. |
  377. |    When printing Microsoft Windows files that have been captured on a 
  378. |    PC's LPT port, you mostly need to define two ctrl-d's in a row as 
  379. |    well to remove all of them in the document: 
  380. |
  381. |  
  382. |  (\004\004) cvn \{\} def
  383.   
  384.  
  385. Subject: 8.3 Apple Macintosh 
  386.  
  387.     For more details about printing with the Macintosh, read the 
  388.     comp.sys.mac.apps FAQ. 
  389.  
  390.     How can I convert a PostScript file created with a UNIX program to 
  391.     the Mac? 
  392.  
  393.     A way that is clumsy, but works, is this: 
  394.  
  395.  
  396.  
  397.    1. Display the UNIX-based PostScript file on screen 
  398.  
  399.  
  400.    2. Use window dumping facility to get a bitmap file 
  401.  
  402.  
  403.    3. Convert the above bitmap file to TIFF format and then export it 
  404.       to Adobe Illustrator on the Mac. 
  405.  
  406.     The PostScript section of the FAQ for the Macintosh newsgroup 
  407.     comp.sys.mac.app (maintained by Elliotte Harold) answers the 
  408.     following questions: 
  409.  
  410.  
  411.  
  412.     * How do I make a PostScript file? 
  413.  
  414.  
  415.     * How do I print a PostScript file? 
  416.  
  417.  
  418.     * Why won't my PostScript file print on my mainframe's printer? 
  419.  
  420.       Full documentation of this process provided with a utility called 
  421.       macps. 
  422.  
  423.  
  424.     * Why are my PostScript files so big? 
  425.  
  426.  
  427. Subject: 9 Encapsulated PostScript 
  428.  
  429.  
  430. Subject: 9.1 What is Encapsulated PostScript? 
  431.  
  432. |   Encapsulated PostScript (EPS) is a standard format for importing 
  433.     and exporting PostScript language files in all environments. It is 
  434.     usually a single page PostScript language program that describes an 
  435.     illustration. The purpose of the EPS file is to be included as an 
  436.     illustration in other PostScript language page descriptions. The 
  437.     EPS file can contain any combination of text, graphics, and images. 
  438.     An EPS file is the same as any other PostScript language page 
  439.     description, with some restrictions. 
  440.  
  441.     EPS files can optionally contain a bitmapped image preview, so that 
  442.     systems that can't render PostScript directly can at least display 
  443.     a crude representation of what the graphic will look like. There 
  444.     are three preview formats: Mac (PICT), IBM (tiff), and a platform 
  445.     independent preview called EPSI. 
  446.  
  447.     An EPS file must be a conforming file, that is, it must conform to 
  448.     the Adobe Document Structuring Conventions (DSC). At a minimum, it 
  449.     must include a header comment,%!PS-Adobe-3.0 EPSF-3.0, and a 
  450.     bounding box comment,%%BoundingBox: llx lly urx ury, that 
  451.     describes the bounds of the illustration. 
  452.  
  453.     (The specification does not require the EPSF version, but many 
  454.     programs will reject a file that does not have it.) 
  455.  
  456.     The EPS program must not use operators that initialize or 
  457.     permanently change the state of the machine in a manner that cannot 
  458.     be undone by the enclosing application's use of save and restore 
  459.     (eg. the operators starting with ``init'' like initgraphics). As a 
  460.     special case, the EPS program may use the showpage operator. The 
  461.     importing application is responsible for disabling the normal 
  462.     effects of showpage. 
  463.  
  464.     The EPS program should make no environment-sensitive decisions (the 
  465.     importing application may be trying to attain some special effect, 
  466.     and the EPS program shouldn't screw this up), although it can use 
  467.     some device-dependent tricks to improve appearance such as a 
  468.     snap-to-pixel algorithm. 
  469.  
  470.     The complete EPS specification is available from Adobe (see the 
  471.     section on Adobe). 
  472.  
  473.     An optional component of an EPS file is a ``preview'' image of the 
  474.     file's content. The preview image is a bitmapped representation of 
  475.     the image which may be displayed by programs using the EPS file 
  476.     without having to actually interpret the PostScript code. 
  477.  
  478.     The recommended form for a preview image is ``Interchange'' format 
  479.     and is described fully in the ``red book'', second edition. 
  480.     Interchange format represents the image as a series of hex strings 
  481.     placed in the EPS file as PostScript comments. The entire file 
  482.     remains an ASCII file. 
  483.  
  484.     A variation of EPS embeds the preview image and PostScript text in 
  485.     a binary file which contains a header and the preview image in 
  486.     either a TIFF or MetaFile format. The header defines where in the 
  487.     file each section (EPS, TIFF, or MetaFile) starts and ends. On the 
  488.     Macintosh, the preview is stored as a PICT in the file's resource 
  489.     fork. 
  490.  
  491. Subject: 9.2 What are EPSI and EPSF? 
  492. |
  493. |   EPSI is EPS with a device independent bitmap preview. EPSI is an 
  494. |   all ASCII (no binary data or headers) version of EPS. EPSI provides 
  495. |   for a hexadecimal encoded preview representation of the image that 
  496. |   will be displayed or printed. 
  497. |
  498. |   EPSF is a version of EPS with a TIFF preview instead of a bitmap 
  499. |   preview. 
  500.  
  501.  
  502. Subject: 9.3 How do I convert PostScript to EPS? 
  503.  
  504.     To convert from PostScript to EPS, one must guarantee that the 
  505.     PostScript file meets the above requirements. If the actual program 
  506.     conforms to the programming requirements, then one can simply add 
  507.     the required comments at the top of the file saying that the file 
  508.     is EPS and giving its BoundingBox dimensions. 
  509.  
  510.     Optional comments include font usage (%%DocumentFonts: or%% 
  511.     DocumentNeededResources: font), EPSI preview comments (%% 
  512.     Begin(End)Preview:) extensions (%%Extensions:) and language 
  513.     level (%%LanguageLevel:). 
  514.  
  515.     There are some operators that should not be used within an EPS 
  516.     file: 
  517.  
  518.   
  519.           banddevice     cleardictstack   copypage     erasepage
  520.           exitserver     framedevice      grestoreall  initclip
  521.           initgraphics   initmatrix       quit         renderbands
  522.           setglobal      setpagedevice    setshared    startjob
  523.   
  524.     These also include operators from statusdict and userdict operators 
  525.     like legal, letter, a4, b5, etc. 
  526.  
  527.     There are some operators that should be carefully used: 
  528.   
  529.           nulldevice     setgstate        sethalftone  setmatrix
  530.           setscreen      settransfer      undefinefont
  531.   
  532.     To convert a PostScript file to EPS format, you must edit the file 
  533.     using a text editor or word processor to add lines that will define 
  534.     the file as an EPS-format file. 
  535.  
  536.  
  537.  
  538.    1. Using your normal method of printing, print the PostScript file 
  539.       to a PostScript printer. You can choose to view it on the screen 
  540.       instead, but keep in mind that all the below distance 
  541.       measurements assume that you are printing on a normal-sized piece 
  542.       of paper. 
  543.  
  544.       NOTE: If the PostScript image does not get displayed properly, it 
  545.       probably will not work either once you have converted it to EPS 
  546.       format. Correct the PostScript program so that it works before 
  547.       you convert it to EPS format. 
  548.  
  549.  
  550.    2. Use a tool (see below) to find the bounding box, which shows how 
  551.       much space the PostScript image occupies when printed. You 
  552.       specify the dimensions of the bounding box when you convert the 
  553.       PostScript file to EPS format. 
  554.  
  555.  
  556.    3. If you don't have a bounding box tool, you can just use a ruler 
  557.       and draw one on your printout. With two horizontal lines and two 
  558.       vertical lines, draw a box around the image that includes the 
  559.       entire image while minimizing white space. 
  560.  
  561.       This box represents your bounding box. You may want to leave a 
  562.       small amount of white space around the image as a precautionary 
  563.       measure against minor printing problems, such as paper stretching 
  564.       and paper skewing. 
  565.  
  566.  
  567.    4. Measure distance ``a'' from the lower-left corner of the image to 
  568.       the left edge of the paper. 
  569.  
  570.  
  571.    5. Write the measurement in points. If your ruler does not show 
  572.       points, calculate the total number of points: 1 inch = 72 points, 
  573.       1 cm = 28.3 points, and 1 pica = 12 points. Designate this 
  574.       measurement as ``measurement a.'' 
  575.  
  576.  
  577.    6. Measure distance ``b'' from the lower-left corner of the image to 
  578.       the bottom edge of the paper. 
  579.  
  580.       Designate this measurement in points as ``measurement b.'' 
  581.  
  582.  
  583.    7. Measure distance ``c'' from the upper-right corner of the image 
  584.       to the left edge of the paper. 
  585.  
  586.       Designate this measurement in points as ``measurement c.'' 
  587.  
  588.  
  589.    8. Measure distance ``d' from the upper-right corner of the image to 
  590.       the bottom edge of the paper. 
  591.  
  592.       Designate this measurement in points as ``measurement d.'' 
  593.  
  594.  
  595.    9. Using any text editor, open the PostScript file for editing. 
  596.  
  597.       You'll see several lines of text. These lines are the PostScript 
  598.       description of the image. The lines at the top of the file are 
  599.       the header. 
  600.  
  601.  
  602.   10. Add these lines to, or modify existing lines in, the header (the 
  603.       first group of lines in any PostScript file): 
  604.  
  605.     
  606.             %!Adobe-2.0 EPSF
  607.             %%Creator: name
  608.             %%CreationDate: date
  609.             %%Title: filename
  610.             %%BoundingBox: a b c d
  611.     
  612.       Note: Make sure that the first line in the file is `` Also, do 
  613.       not separate the header lines with a blank line space. The first 
  614.       blank line that PostScript encounters tells it that the the next 
  615.       line begins the body of the program. 
  616.  
  617.       For ``name,'' type your name or initials. For ``date,'' type 
  618.       today's date using any format (for example, MM-DD-YY, MM/DD/YY, 
  619.       July 5, 1987, and so on). For ``filename,'' type the name of the 
  620.       PostScript file. After ``BoundingBox: ,'' type the measurements 
  621.       you took in steps 3, 4, 5, and 6, separating each with a space: 
  622.       ``a'' is the measurement from Step 3, ``b'' is the measurement 
  623.       from Step 4, ``c'' is the measurement from Step 5, and ``d'' is 
  624.       the measurement from Step 6. 
  625.  
  626.  
  627.   11. Save the file in text-only format. 
  628.  
  629.     If you are interested in learning how to further edit your 
  630.     PostScript files, these books are available at most bookstores: 
  631.  
  632.     Understanding PostScript Programming and the green book. 
  633.  
  634.     Encapsulated PostScript is discussed in Appendix C of the old red 
  635.     book. The new red book has a lot of information about Encapsulated 
  636.     PostScript. 
  637.  
  638.     There will be a technical note available from Adobe called 
  639.     'Guidelines for Specific Operators' that will talk about why some 
  640.     operators are prohibited and how to use the others. 
  641.  
  642.  
  643. Subject: 9.4 How do I get the bounding box of a PostScript picture? 
  644.  
  645.     Use bbfig or epsinfo.ps. 
  646.  
  647.     Or if you would rather construct the bounding box by hand, use 
  648.     Ghostview, which has a continuous readout of the mouse cursor in 
  649.     the default user coordinate system. You simply place the mouse in 
  650.     the corners of the figure and read off the coordinates. 
  651.  
  652. Subject: 10 About The Comp.Lang.PostScript FAQ (and Usenet Guide to 
  653.     PostScript) 
  654.  
  655.  
  656. Subject: 10.1 The PostScript FAQ: What is it? 
  657.  
  658.     The PostScript FAQ is a set of answers to frequently asked 
  659.     questions (FAQs) that have appeared on the Usenet newsgroup 
  660.     comp.lang.postscript. It is broken into many useful sections. 
  661.  
  662.     The Usenet Guide to PostScript is a larger set of help and answers 
  663.     to PostScript questions, plus a tutorial for new users. It is still 
  664.     in the process of being created. There is one file ``Exactly What 
  665.     Does a Transformation Matrix Do?'', that is definitely not part of 
  666.     the FAQ. Please send more! 
  667.  
  668.     I need help writing and revising answers for common questions 
  669.     relating to PostScript. Almost all of the information in the 
  670.     documents has been written by kind volunteers. The answers will be 
  671.     published in either or both documents. A very long answer in the 
  672.     Usenet Guide may be summarized, referred to briefly, or not 
  673.     mentioned at all in the FAQ. 
  674.  
  675.  
  676. Subject: 10.2 How to get the FAQ files 
  677.  
  678.     The FAQ is available by anonymous ftp to 
  679.     wilma.cs.brown.edu:pub/comp.lang.postscript/ You can get it 
  680.     formatted in plain text ASCII, LaTeX, or PostScript. 
  681.  
  682.     I would be happy to email a copy of the FAQ in any format to you if 
  683.     you do not have FTP. 
  684.  
  685.  
  686. Subject: 10.3 How to write a FAQ answer 
  687.  
  688.     I greatly appreciate your time and effort to help improve the 
  689.     quality of the FAQ. Thank you for being willing to contribute! 
  690.  
  691.  
  692.     * Please check to see if the topic is already in an FAQ. Perhaps 
  693.       you really mean to submit a revision to an existing section. 
  694.  
  695.     * Start with a clear statement about what problem you are solving. 
  696.  
  697.     * Write for novice users, in ``tutorial format'', even if the 
  698.       answer is meant for experienced programmers. 
  699.  
  700.     * Be specific when you make references. 
  701.  
  702.     * Be complete, and take the time to look over your draft and 
  703.       revise. 
  704.  
  705.     * Answers should not be too wordy, unless you intend to write a 
  706.       long answer for the Usenet Guide and have a shorter summary or a 
  707.       pointer to the description placed in the FAQ. If you want to 
  708.       write the summary yourself, thanks! 
  709.  
  710.     * Obviously, I cannot accept copyrighted material without 
  711.       permission. Don't write the FAQ by paraphrasing from a 
  712.       copyrighted book! 
  713.  
  714.  
  715. Subject: 10.4 The FAQ can contain LaTeX and PostScript inserts 
  716.  
  717.     The FAQ is actually written with LaTeX, so feel free to submit with 
  718.     that text formatting language. There is a PostScript version of the 
  719.     FAQ also, so feel free to send along PostScript pictures to 
  720.     include. 
  721.  
  722.  
  723. Subject: 10.5 Revising the FAQ 
  724.  
  725.     Suggestions and comments are welcomed. My favorite way of receiving 
  726.     a change suggestion is if you make a copy of the FAQ, edit the 
  727.     copy, and mail me the modification, or a context diff (include the 
  728.     version number). 
  729.  
  730.  
  731. Subject: 10.6 How to submit new information 
  732.  
  733.     If you know something that you think is worthwhile to be put in a 
  734.     FAQ, definitely send it to me! 
  735.  
  736.     Don't hold back if your information is very specific. If there's 
  737.     too much information to post I will archive it at an ftp site and 
  738.     place a pointer to it in the FAQ. 
  739.  
  740.  
  741. Subject: 10.7 How to add a program description to the FAQ index 
  742.  
  743.     If the program is original, please send it to me, or tell me where 
  744.     I can get it. Please put your name and email address at the top of 
  745.     each file. Your program will be doubly useful if you clean up the 
  746.     program so that other people can use it as an example to learn. 
  747.  
  748.     If the program was written by someone else, please send me just the 
  749.     title, description, and where to get it. I may already have it. 
  750.  
  751.     For programs the FAQ needs to know: 
  752.  
  753.  
  754.     * What is the name of the program? 
  755.  
  756.     * What does it claim to do, and does it do it well? Is it worth 
  757.       using? 
  758.  
  759.     * Where is it available? What ftp sites can I get it from? 
  760.  
  761.     * How much does it cost? Is it free? 
  762.  
  763.     * What kinds of computers does it run on? 
  764.  
  765.     * Who is the author and does the author give an email address? 
  766.  
  767.     * Does it handle PostScript 2? 
  768.  
  769.     If the program is a PostScript interpreter, then the FAQ also needs 
  770.     to know: 
  771.  
  772.  
  773.     * Does it let you go backwards one page? 
  774.  
  775.     * Does it display the number of pages in the document? 
  776.  
  777.     * Does it let you print PostScript to a non-PostScript printer? 
  778.  
  779.     * What formats can it convert to? 
  780.  
  781.  
  782. Subject: 10.8 How to add a book description to the FAQ 
  783.  
  784.     For books the FAQ needs to know: 
  785.  
  786.  
  787.     * What is the name of the book or document? 
  788.  
  789.     * What does it claim to do, and does it do it well? Is it worth 
  790.       using? 
  791.  
  792.     * Can I get it on-line? 
  793.  
  794.     * Who wrote it? Does the author give an email address? 
  795.  
  796.     * Who is the publisher, and what is the copyright date? 
  797.  
  798.     * Does the publisher list an address and phone number or fax 
  799.       number? 
  800.  
  801.     * What is the ISBN number of the book? 
  802.  
  803.     * What is the library call number of the book? 
  804.  
  805.     * How much does the book cost? 
  806.  
  807.     * Does it cover PostScript 2? 
  808.  
  809.     * Are coding examples from the book available by email or anonymous 
  810.       ftp? 
  811.  
  812.     * Do the authors sell the coding examples on a diskette? 
  813.  
  814.  
  815. Subject: 10.9 Questions that need answers 
  816.  
  817.  
  818.  
  819.    1. Where are ftp sites that have PostScript freeware? 
  820.  
  821.  
  822.    2. What vendors sell fonts for PostScript printers? Where are the 
  823.       free ftp sites for them? 
  824.  
  825.  
  826.    3. Are there any free encapsulated PostScript converters? 
  827.  
  828.  
  829.    4. What is the charter for comp.lang.postscript? 
  830.  
  831.  
  832.    5. How do I make a downloaded font (ie: PFA) persistent? 
  833.  
  834.  
  835.    6. What questions should the FAQ have? 
  836.  
  837.  
  838.    7. What book information is wrong or missing in the FAQ? 
  839.  
  840.  
  841.    8. What program information is wrong or missing in the FAQ? 
  842.  
  843.  
  844.    9. What ftp site have good examples of PostScript code? 
  845.  
  846.